import { conversationTemplate } from "../config.js";
import { readFileSync, writeFileSync } from "fs";
let conTemp = conversationTemplate;
export var Conversation;
(function (Conversation) {
    let ConversationStr;
    (function (ConversationStr) {
        ConversationStr["Creative"] = "h3imaginative";
        ConversationStr["Precise"] = "h3precise";
        ConversationStr["Balanced"] = "galileo";
    })(ConversationStr = Conversation.ConversationStr || (Conversation.ConversationStr = {}));
})(Conversation || (Conversation = {}));
const { Balanced } = Conversation.ConversationStr;
export function ctrlTemp(path = "./temp", file) {
    try {
        if (file) {
            return writeFileSync(path, file, "utf8");
        }
        return readFileSync(path, "utf8");
    }
    catch (error) { }
}
export function setConversationTemplate(params = {}) {
    const { convStyle = Balanced, messageType = "Chat", conversationId, conversationSignature, clientId } = params;
    if (!conversationId || !conversationSignature || !clientId)
        return null;
    const args = conTemp.arguments[0];
    conTemp.arguments[0] = {
        ...args,
        conversationId,
        conversationSignature,
        participant: { id: clientId }
    };
    args.optionsSets.push(convStyle);
    args.message.messageType = messageType;
    return conTemp;
}
